// Created by Charles on 2020/7/27--15:47.
<template>
    <div>
        <v-dialog
            title="结算方式设置详情"
            :show.sync="dialogVisible"
            width="1200px">
            <div class="data-info">
                <div class="info-list mb20">

                    <dl>
                        <dt>结算方式类型</dt>
                        <dd>{{settlementType}}</dd>
                    </dl>
                    <dl>
                        <dt>结算方式名称</dt>
                        <dd v>{{data.settlementName}}</dd>
                    </dl>
                    <dl>
                        <dt>结算方式编码</dt>
                        <dd>{{data.settlementCode}}</dd>
                    </dl>
                    <dl>
                        <dt>备注</dt>
                        <dd>{{data.remarks}}</dd>
                    </dl>
                </div>


            </div>
            <span slot="foot">
            <el-button @click="dialogVisible = false">取 消</el-button>
          </span>
        </v-dialog>
    </div>
</template>

<script>
    import {getObj} from '../../../api/finance-manage-settlement'
    import {getDict} from "~/utils";

    export default {
        data() {
            return {
                data: {},
                tableData: [
                ],
                dialogVisible: false
            }
        },
        computed: {
            settlementType: function () {
                let dict =getDict('settlement_type')
                let settlementKey = this.data.settlementType;
                if(settlementKey && dict.length > 0){
                    const settlement = dict.filter(t => t.value == settlementKey)
                    return settlement ? settlement[0].label : ''
                }
                return ''
            }
        },
        methods: {
            show(item) {
                console.log(item)
                getObj(item.settlementId).then(resp => {
                    this.dialogVisible = true
                    this.data = resp.data.data
                })
            }
        }
    }
</script>

<style lang='scss' scoped>
    

    @include data-title();

    @include info-list();
</style>
